function checkPassword(password){

	var retVal=true;
	if(checkLength(password)==false){
		$(".p1").css({"color":"red"});
		retVal=false;
	}else{
		$(".p1").css({"color":"green"});
	}
	if(checkHasUpperCase(password)==false){
		retVal=false;
		$(".p2").css({"color":"red"});
	}else{
		$(".p2").css({"color":"green"});
	}
	if(checkHasLowerCase(password)==false){
		retVal=false;
		$(".p3").css({"color":"red"});
	}else{
		$(".p3").css({"color":"green"});
	}
	if(checkHasNumber(password)==false){
		retVal=false;
		$(".p4").css({"color":"red"});
	}else{
		$(".p4").css({"color":"green"});
	}
	if(checkHasSpecialChar(password)==false){
		retVal=false;
		$(".p5").css({"color":"red"});
	}else{
		$(".p5").css({"color":"green"});
	}
	return retVal;
}


function doCheckPassword(password, reg) {
	var pattern=new RegExp(reg);
	return pattern.test(password);
}
function checkHasSpecialChar(password){
	var reg="[`~!@#$^&*()=|{}':;',\\[\\].<>/?~！@#￥……&*（）——|{}【】‘；：”“'。，、？]";
	return doCheckPassword(password, reg);
}
function checkHasLowerCase(password){
	var reg="[a-z]";
	return doCheckPassword(password, reg);
}
function checkHasUpperCase(password){
	var reg="[A-Z]";
	return doCheckPassword(password, reg);
}
function checkHasNumber(password){
	var reg="[0-9]";
	return doCheckPassword(password, reg);
}

function checkLength(password){
	var length=password.length;
	if(length<8||length>12){
		return false;
	}
	return true;
}